const db = require('@/db/db-connection')

class ToolModel {
  async findOne (id) {
    const sql = 'SELECT * FROM tool WHERE id = ?'

    try {
      const data = await db.query(sql, [id])

      return data[0]
    } catch (error) {
      throw new Error(error)
    }
  }
}

module.exports = new ToolModel()
